# -*- coding: utf-8 -*-

"""
@Datetime: 2019/1/2
@Author: Zhang Yafei
"""
from application import app
from importlib import import_module


def admin_auto_discover():
    apps = app.config.get('INSTALLED_APPS')
    if apps:
        for app_name in apps:
            try:
                __import__('{}.admin'.format(app_name))
            except:
                try:
                    import_module('{}.admin'.format(app_name))
                except Exception as e:
                    print(e)
